package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-09-19
 * Time: 10:37
 */
public class Account {
    public int id;
    public String name;
    public double balance;
    public Account(){
        id=0;
        name=" ";
        balance=0.0;
    }

    public void setId(int id) {
        this.id =id;

    }

    public void setName(String name) {
        this.name =name;

    }

    public void setBalance(double balance) {
        this.balance =balance;

    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
    public double getBalance(){
        return balance;
    }
    public void deposite(double amount){
        balance=this.balance+amount;

    }
    public void withdraw(double amount){
        balance=this.balance-amount;

    }

    public static void main(String[] args) {
        Account account=new Account();
        account.id=101;
        account.name="张大海";
        account.balance=100;
        account.deposite(300);
        account.withdraw(800);
        System.out.println(account.id);
        System.out.println(account.name);
        System.out.println(account.balance);
    }
}

